<template>
	<view class="contain">
		<view class="conbox">
			<view class="img">
				<image src="../../static/uni.png" style="width: 300rpx;border-radius: 50%;" mode="widthFix"></image>
			</view>
		</view>
		<view class="" style="margin-top: 100rpx;">
			<uni-forms :modelValue="formData">
						<uni-forms-item label="账号" name="name">
							<uni-easyinput type="text" v-model="formData.userName" placeholder="请输入姓名" />
						</uni-forms-item>
						<uni-forms-item label="密码" name="password">
							<uni-easyinput type="text" v-model="formData.password" placeholder="请输入密码" />
						</uni-forms-item>	
						<uni-forms-item label="电话号码" name="password">
							<uni-easyinput type="text" v-model="formData.phonenumber" placeholder="请输入密码" />
						</uni-forms-item>
							<uni-forms-item label="性别" name="sex">
								<radio-group name="性别" @change="radio">
									<label>
										<radio value="0" checked /><text>男</text>
									</label>
									<label>
										<radio value="1" /><text>女</text>
									</label>
								</radio-group>
							</uni-forms-item>
			</uni-forms>
			<button type="primary" @click="regin">注册</button>
		</view>
	</view>
</template>

<script>
	import {request} from '@/utils/request.js'
	export default {
		data() {
			return {
				formData:{
					userName:"test01",
					password:"123456",
					phonenumber:"123456789",
					sex:"0"
				}
				
			}
		},
		onLoad() {
			// this.regin()
			
		},
		methods: {
			radio(e){
				this.formData.sex=e.detail.value
			},
			async regin(){
				console.log(this.formData)
				const res=await request({url:"prod-api/api/register",method:'post',data:this.formData})
				console.log(res)
			},
			
		}
	}
</script>

<style>
	.img{
		margin-top: 30rpx;
		text-align: center;
	}

</style>
